package com.mebs.edi.model.edi.e214;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embeddable;

import com.mebs.edi.model.dom.DomAttribute;
import com.mebs.edi.model.dom.DomEntity;

/**
 * 
 * AT section of a 214 EDI file 
 * 
 * @author nit
 *
 */
@Embeddable
@DomEntity(name = "AT", discriminatorAttribute = "AT701")
public class Edi214At {
	
	@Column(nullable = true, length = 3)
	@DomAttribute
	private String at701; 	// Shipment Status Code
	
	@Column(nullable = true, length = 3)
	@DomAttribute
	private String at702; 	// Shipment Status or Appointment Reason Code
	
	@Column(nullable = true)
	@DomAttribute
	private Date at705; 	// Milestone Date
	
	@Column(nullable = true, length = 2)
	@DomAttribute
	private String at801; 	// Weight Qualifier
	
	@Column(nullable = true)
	@DomAttribute
	private Character at802; 	// Weight Unit Code
	
	@Column(nullable = true, length = 10)
	@DomAttribute
	private Float at803; 	// Weight
	
	@Column(nullable = true, length = 7)
	@DomAttribute
	private Long at804; 	// Lading Quantity
	
	@Column(nullable = true)
	@DomAttribute
	private Character at806; 	// Volume Unit Qualifier
	
	@Column(nullable = true, length = 8)
	@DomAttribute
	private Float at807; 	// Volume
	
	public Edi214At() {
		super();
	}

	public String getAt701() {
		return at701;
	}

	public void setAt701(String at701) {
		this.at701 = at701;
	}

	public String getAt702() {
		return at702;
	}

	public void setAt702(String at702) {
		this.at702 = at702;
	}

	public Date getAt705() {
		return at705;
	}

	public void setAt705(Date at705) {
		this.at705 = at705;
	}

	public String getAt801() {
		return at801;
	}

	public void setAt801(String at801) {
		this.at801 = at801;
	}

	public Character getAt802() {
		return at802;
	}

	public void setAt802(Character at802) {
		this.at802 = at802;
	}

	public Float getAt803() {
		return at803;
	}

	public void setAt803(Float at803) {
		this.at803 = at803;
	}

	public Long getAt804() {
		return at804;
	}

	public void setAt804(Long at804) {
		this.at804 = at804;
	}

	public Character getAt806() {
		return at806;
	}

	public void setAt806(Character at806) {
		this.at806 = at806;
	}

	public Float getAt807() {
		return at807;
	}

	public void setAt807(Float at807) {
		this.at807 = at807;
	}

	@Override
	public String toString() {
		return "Edi214At [at701=" + at701 + ", at702=" + at702 + ", at705=" + at705 + ", at801=" + at801
				+ ", at802=" + at802 + ", at803=" + at803 + ", at804=" + at804 + ", at806=" + at806
				+ ", at807=" + at807 + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((at701 == null) ? 0 : at701.hashCode());
		result = prime * result + ((at702 == null) ? 0 : at702.hashCode());
		result = prime * result + ((at705 == null) ? 0 : at705.hashCode());
		result = prime * result + ((at801 == null) ? 0 : at801.hashCode());
		result = prime * result + ((at802 == null) ? 0 : at802.hashCode());
		result = prime * result + ((at803 == null) ? 0 : at803.hashCode());
		result = prime * result + ((at804 == null) ? 0 : at804.hashCode());
		result = prime * result + ((at806 == null) ? 0 : at806.hashCode());
		result = prime * result + ((at807 == null) ? 0 : at807.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Edi214At other = (Edi214At) obj;
		if (at701 == null) {
			if (other.at701 != null)
				return false;
		} else if (!at701.equals(other.at701))
			return false;
		if (at702 == null) {
			if (other.at702 != null)
				return false;
		} else if (!at702.equals(other.at702))
			return false;
		if (at705 == null) {
			if (other.at705 != null)
				return false;
		} else if (!at705.equals(other.at705))
			return false;
		if (at801 == null) {
			if (other.at801 != null)
				return false;
		} else if (!at801.equals(other.at801))
			return false;
		if (at802 == null) {
			if (other.at802 != null)
				return false;
		} else if (!at802.equals(other.at802))
			return false;
		if (at803 == null) {
			if (other.at803 != null)
				return false;
		} else if (!at803.equals(other.at803))
			return false;
		if (at804 == null) {
			if (other.at804 != null)
				return false;
		} else if (!at804.equals(other.at804))
			return false;
		if (at806 == null) {
			if (other.at806 != null)
				return false;
		} else if (!at806.equals(other.at806))
			return false;
		if (at807 == null) {
			if (other.at807 != null)
				return false;
		} else if (!at807.equals(other.at807))
			return false;
		return true;
	}
}